
module.exports = {
  lintOnSave: true,
  productionSourceMap: false,
  assetsDir: "static",
  parallel: false,
  publicPath: "./",
  runtimeCompiler: true,
  devServer: {
    host: "localhost",
    port: "8888",
    open: true,
    hot: true,
    proxy: {
      '/api': {
        target: 'http://172.31.2.176:9301',
        // target: 'http://172.31.2.176:19300'
        // pathRewrite: {
        //   '^/api' : '/'
        // }
        changeOrigin: true
      },
      '/v1': {
        target: 'http://172.31.2.176:19300',
        changeOrigin: true
      },
      '/logger': {
        target: 'http://172.31.2.176:61400'
      }
    }
  },
  configureWebpack: {
    output: {
      libraryExport: "default"
    }
  },
  chainWebpack: config => {
    if(process.env.NODE_ENV === 'development') {
      config
        .plugin('html')
        .tap(args => {
          args[0].title= 'UniLoginSDK'
          args[0].recaptchaId= process.env.VUE_APP_RECAPTCHA_ID
          return args
        })
    }
  },
  css: {
    extract: false,
    loaderOptions: {
      sass: {
        implementation: require('sass'), // This line must in sass option
      },
    }
  }
};
